# download_model.py
from transformers import AutoTokenizer, AutoModel

# 指定下载目录
#cache_dir = "./models"
cache_dir = r"D:\demo\gitee\python\models\text2vec-base-chinese"

# 下载模型和分词器
print("开始下载模型...")
tokenizer = AutoTokenizer.from_pretrained(
    "shibing624/text2vec-base-chinese", 
    cache_dir=cache_dir
)
model = AutoModel.from_pretrained(
    "shibing624/text2vec-base-chinese", 
    cache_dir=cache_dir
)
print("模型下载完成！")